package com.jx.lcs.feedbackinfo.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.jx.lcs.employee.entity.Employee;

/**
 * 用户entity
 * @author ty
 * @date 2015年1月13日
 */
@Entity
@Table(name = "tb_feedback_info")
@DynamicUpdate @DynamicInsert
public class FeedBackInfo implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	private String id;
	private String uid;
	private String content;
	private Employee employee;

	private Date recordTime = new Date();
	//private String url;
	//private Employee employee;
	
	// Constructors

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "UID",insertable = false,updatable = false)
	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	@Column(name = "CONTENT")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "RECORDTIME", updatable = false, nullable = false, length = 20)
	public Date getRecordTime() {
		return recordTime;
	}

	public void setRecordTime(Date recordTime) {
		this.recordTime = recordTime;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public FeedBackInfo() {
		// TODO Auto-generated constructor stub
	}
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "UID", referencedColumnName="USERCODE")
	public Employee getEmployee() {
		return this.employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

}